<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta charset="utf-8"/>
    <title>     &raquo; \tfc\validator
</title>
    <meta name="author" content=""/>
    <meta name="description" content=""/>

            <link href="../css/template.css" rel="stylesheet" media="all"/>
    
            <!--[if lt IE 9]>
        
        <![endif]-->
        <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
        <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script>
        <script src="../js/bootstrap.js" type="text/javascript"></script>
        <script src="../js/template.js" type="text/javascript"></script>
        <script src="../js/prettify/prettify.min.js" type="text/javascript"></script>
    
            <link rel="shortcut icon" href="../img/favicon.ico"/>
        <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/>
        <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/>
    </head>
<body>

        <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span> <span class="icon-bar"></span>
                    <span class="icon-bar"></span> </a>
                <a class="brand" href="http://www.trotri.com/">Trotri官网</a><a class="brand" href="../index.html">TFC-Trotri Foundation Classes</a>

                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="dropdown">
                            <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                API Documentation <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                                                    <li><a>Namespaces</a></li>
                                                                        <li><a href="../namespaces/tfc.html">tfc</a></li>
                                                                                                                                </ul>
                        </li>
                        <li class="dropdown" id="charts-menu">
                            <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                Charts <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../graph_class.html">
                                        <i class="icon-list-alt"></i>&#160;Class hierarchy diagram
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown" id="reports-menu">
                            <a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                Reports <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../errors.html">
                                         
                                    </a>
                                </li>
                                <li>
                                    <a href="../markers.html">
                                        <i class="icon-list-alt"></i>&#160;Markers
                                    </a>
                                </li>
                                <li>
                                    <a href="../deprecated.html">
                                        <i class="icon-list-alt"></i>&#160;Deprecated
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="go_to_top">
            <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>
        </div>
    </div>
    
    <div id="___" class="container">
        <noscript>
            <div class="alert alert-warning">
                Javascript is disabled; several features are only available if Javascript is enabled.
            </div>
        </noscript>

        
            
    <div class="row">

        <div class="span4">
            <div class="btn-group view pull-right" data-toggle="buttons-radio">
                <button class="btn details" title="Show descriptions and method names">
                    <i class="icon-list"></i></button><button class="btn simple" title="Show only method names">
                    <i class="icon-align-justify"></i>
                </button>
            </div>
            <ul class="side-nav nav nav-list">
                <li class="nav-header">
                    <i class="icon-map-marker"></i> Namespaces
                </li>
                    
    
            </ul>
        </div>

        <div class="span8 namespace-contents">
                
    
        <ul class="breadcrumb">
            <li><a href="../index.html"><i class="icon-th"></i></a></li>
                
                
    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.html">tfc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.validator.html">validator</a>
    </li>

        </ul>

        
        
                    <div class="namespace-indent">
                <h3><i class="icon-custom icon-class"></i> Classes, interfaces and traits</h3>
                
                
                                        <div id="class_Filter" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Filter .collapse">
        <h1>Filter<a href="../classes/tfc.validator.Filter.html">¶</a></h1>
        <p class="short_description">Filter class file
数据验证类</p>
        <div class="details collapse"><p>验证规则：</p>
<pre>
$rules = array(
    'user_loginname' => array(
        'MinLength' => array(6, '用户名长度%value%不能小于%option%个字符.'),
        'MaxLength' => array(12, '用户名长度%value%不能大于%option%个字符.')
    ),
    'user_password' => array(
        'tfc\\validator\\MinLengthValidator' => array(6, '密码长度%value%不能小于%option%个字符.'),
        'MaxLength' => array(12, '密码长度%value%不能大于%option%个字符.')
    ),
    'user_email' => array(
        'MaxLength' => array(50, '邮箱长度%value%不能大于%option%个字符.'),
        'Mail' => array(true, '邮箱%value%不符合规范.')
    ),
);

$params = array(
    'user_loginname' => 'abcdefghi',
    'user_password' => '1234',
    'user_email' => 'trotriyeahnet'
);

$filter = new Filter();
$result = $filter->run($rules, $params);
$errors = $filter->getErrors();
结果：
$errors = array(
    'user_password' => '密码长度1234不能小于6个字符.',
    'user_email' => array('邮箱长度trotriyeahnet...不能大于50个字符.', '邮箱iphperyeahnet...不符合规范.')
);
</pre></div>
        <a href="../classes/tfc.validator.Filter.html" class="more">« More »</a>    </div>

                                        <div id="class_NotEmptyValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_NotEmptyValidator .collapse">
        <h1>NotEmptyValidator<a href="../classes/tfc.validator.NotEmptyValidator.html">¶</a></h1>
        <p class="short_description">NotEmptyValidator class file
验证一个值是否不为空</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.NotEmptyValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_RegexValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RegexValidator .collapse">
        <h1>RegexValidator<a href="../classes/tfc.validator.RegexValidator.html">¶</a></h1>
        <p class="short_description">RegexValidator class file
验证正则表达式</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.RegexValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_DbExists2Validator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_DbExists2Validator .collapse">
        <h1>DbExists2Validator<a href="../classes/tfc.validator.DbExists2Validator.html">¶</a></h1>
        <p class="short_description">DbExists2Validator class file
验证值是否在数据库表中是否存在</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.DbExists2Validator.html" class="more">« More »</a>    </div>

                                        <div id="class_EqualToValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_EqualToValidator .collapse">
        <h1>EqualToValidator<a href="../classes/tfc.validator.EqualToValidator.html">¶</a></h1>
        <p class="short_description">EqualToValidator class file
验证值是否等于RGP中的值</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.EqualToValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_IpValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_IpValidator .collapse">
        <h1>IpValidator<a href="../classes/tfc.validator.IpValidator.html">¶</a></h1>
        <p class="short_description">IpValidator class file
验证IP地址</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.IpValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_Validator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Validator .collapse">
        <h1>Validator<a href="../classes/tfc.validator.Validator.html">¶</a></h1>
        <p class="short_description">Validator abstract class file
数据验证基类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.Validator.html" class="more">« More »</a>    </div>

                                        <div id="class_PhoneValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_PhoneValidator .collapse">
        <h1>PhoneValidator<a href="../classes/tfc.validator.PhoneValidator.html">¶</a></h1>
        <p class="short_description">PhoneValidator class file
验证中国大陆手机号</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.PhoneValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_NonNegativeIntegerValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_NonNegativeIntegerValidator .collapse">
        <h1>NonNegativeIntegerValidator<a href="../classes/tfc.validator.NonNegativeIntegerValidator.html">¶</a></h1>
        <p class="short_description">NonNegativeIntegerValidator class file
验证一个值是否是非负整型</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.NonNegativeIntegerValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_NumericValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_NumericValidator .collapse">
        <h1>NumericValidator<a href="../classes/tfc.validator.NumericValidator.html">¶</a></h1>
        <p class="short_description">NumericValidator class file
验证一个值是否是数字类型</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.NumericValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_UrlValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_UrlValidator .collapse">
        <h1>UrlValidator<a href="../classes/tfc.validator.UrlValidator.html">¶</a></h1>
        <p class="short_description">UrlValidator class file
验证Url</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.UrlValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_NotEqualValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_NotEqualValidator .collapse">
        <h1>NotEqualValidator<a href="../classes/tfc.validator.NotEqualValidator.html">¶</a></h1>
        <p class="short_description">NotEqualValidator class file
验证两个值是否不相等</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.NotEqualValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_FloatValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_FloatValidator .collapse">
        <h1>FloatValidator<a href="../classes/tfc.validator.FloatValidator.html">¶</a></h1>
        <p class="short_description">FloatValidator class file
验证一个值是否浮点型</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.FloatValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_EqualValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_EqualValidator .collapse">
        <h1>EqualValidator<a href="../classes/tfc.validator.EqualValidator.html">¶</a></h1>
        <p class="short_description">EqualValidator class file
验证两个值是否相等</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.EqualValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_AlphaNumValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_AlphaNumValidator .collapse">
        <h1>AlphaNumValidator<a href="../classes/tfc.validator.AlphaNumValidator.html">¶</a></h1>
        <p class="short_description">AlphaNumValidator class file
验证英文字母数字和下划线组合</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.AlphaNumValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_RequireValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RequireValidator .collapse">
        <h1>RequireValidator<a href="../classes/tfc.validator.RequireValidator.html">¶</a></h1>
        <p class="short_description">RequireValidator class file
验证是否是安全的可被require的文件</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.RequireValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_MaxValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_MaxValidator .collapse">
        <h1>MaxValidator<a href="../classes/tfc.validator.MaxValidator.html">¶</a></h1>
        <p class="short_description">MaxValidator class file
验证值是否小于指定值</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.MaxValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_DateTimeValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_DateTimeValidator .collapse">
        <h1>DateTimeValidator<a href="../classes/tfc.validator.DateTimeValidator.html">¶</a></h1>
        <p class="short_description">DateTimeValidator class file
验证日期时间
日期时间需要大于1901-12-14 04:51:49</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.DateTimeValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_IntegerValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_IntegerValidator .collapse">
        <h1>IntegerValidator<a href="../classes/tfc.validator.IntegerValidator.html">¶</a></h1>
        <p class="short_description">IntegerValidator class file
验证一个值是否是正整型</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.IntegerValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_AlphaValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_AlphaValidator .collapse">
        <h1>AlphaValidator<a href="../classes/tfc.validator.AlphaValidator.html">¶</a></h1>
        <p class="short_description">AlphaValidator class file
验证英文字母</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.AlphaValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_DbExistsValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_DbExistsValidator .collapse">
        <h1>DbExistsValidator<a href="../classes/tfc.validator.DbExistsValidator.html">¶</a></h1>
        <p class="short_description">DbExistsValidator class file
验证值是否在数据库表中是否存在</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.DbExistsValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_MaxLengthValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_MaxLengthValidator .collapse">
        <h1>MaxLengthValidator<a href="../classes/tfc.validator.MaxLengthValidator.html">¶</a></h1>
        <p class="short_description">MaxLengthValidator class file
验证字符长度是否小于指定长度</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.MaxLengthValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_MinLengthValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_MinLengthValidator .collapse">
        <h1>MinLengthValidator<a href="../classes/tfc.validator.MinLengthValidator.html">¶</a></h1>
        <p class="short_description">MinLengthValidator class file
验证字符长度是否大于指定长度</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.MinLengthValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_MinValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_MinValidator .collapse">
        <h1>MinValidator<a href="../classes/tfc.validator.MinValidator.html">¶</a></h1>
        <p class="short_description">MinValidator class file
验证值是否大于指定值</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.MinValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_InArrayValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_InArrayValidator .collapse">
        <h1>InArrayValidator<a href="../classes/tfc.validator.InArrayValidator.html">¶</a></h1>
        <p class="short_description">InArrayValidator class file
验证值在数组中是否存在</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.InArrayValidator.html" class="more">« More »</a>    </div>

                                        <div id="class_MailValidator" class="element ajax clickable class" data-toggle="collapse" data-target="#class_MailValidator .collapse">
        <h1>MailValidator<a href="../classes/tfc.validator.MailValidator.html">¶</a></h1>
        <p class="short_description">MailValidator class file
验证邮箱</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.validator.MailValidator.html" class="more">« More »</a>    </div>

                            </div>
            
    
        </div>
    </div>
    </div>

        <footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by
            <a href="http://glyphicons.com/">Glyphicons</a>.<br/>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/>
            generated on Sat, 27 Dec 2014 06:16:37 +0000.<br/>
    </footer>
    </body>
</html>
